//
//  TabViewBrowserDemo.m
//  etionUI
//
//  Created by wangjian on 8/19/13.
//
//

#import "TabViewBrowserDemo.h"

@interface CTabViewBrowserDemo ()

@end

@implementation CTabViewBrowserDemo

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    CTabViewBrowser *browser = [[CTabViewBrowser alloc] initWithFrame:self.view.bounds
                                                             tabItems:[NSArray arrayWithObjects:
                                                                       [CTabItem tabItemWithTitle:@"标题0"],
                                                                       [CTabItem tabItemWithTitle:@"标题1"],
                                                                       [CTabItem tabItemWithTitle:@"标题2"],
                                                                       [CTabItem tabItemWithTitle:@"标题3"],
                                                                       [CTabItem tabItemWithTitle:@"标题4"],
                                                                       [CTabItem tabItemWithTitle:@"标题5"],
                                                                       [CTabItem tabItemWithTitle:@"标题6"],
                                                                       [CTabItem tabItemWithTitle:@"标题7"],
                                                                       [CTabItem tabItemWithTitle:@"标题8"], nil]];
    browser.delegate = self;
    [self.view addSubview:browser];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (UIView *)tabViewBorwser:(CTabViewBrowser *)tabViewBorwser contentViewAtIndex:(NSUInteger)index
{
    UIView *view = [[UIView alloc] initWithFrame:tabViewBorwser.contentViewBounds];
    UILabel *lable = [[UILabel alloc] initWithFrame:view.bounds];
    lable.text = [NSString stringWithFormat:@"内容%d", index];
    lable.font = [UIFont boldSystemFontOfSize:30];
    lable.textAlignment = UITextAlignmentCenter;
    [view addSubview:lable];
    return [view autorelease];
}

- (void)tabViewBorwser:(CTabViewBrowser *)tabViewBorwser didMoveToIndex:(NSUInteger)index
{
    
}

@end
